import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class BotTest {
	Bot bot;

	@Before
	public void inicjuj() {
		bot = new Bot("Test");
	}

	@Test
	public void testlosowanie_kart() {
		bot.losowanie_kart();
		assertNotNull(bot.karty);
	}

	@Test
	public void testuzupelnieni_argumentow() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "2";
		bot.karty[1][1] = "3";
		bot.karty[1][2] = "4";
		bot.karty[1][3] = "5";
		bot.karty[1][4] = "6";
		bot.uzupelnieni_argumentow();
		int a[] = new int[5];
		a[0] = 2;
		a[1] = 3;
		a[2] = 4;
		a[3] = 5;
		a[4] = 6;
		assertArrayEquals(bot.argumenty, a);
	}

	@Test
	public void testulozenie_kart() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "2";
		bot.karty[1][1] = "3";
		bot.karty[1][2] = "4";
		bot.karty[1][3] = "5";
		bot.karty[1][4] = "6";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 6;
		a[1] = 5;
		a[2] = 4;
		a[3] = 3;
		a[4] = 2;
		assertArrayEquals(bot.argumenty, a);

	}

	@Test
	public void testkareta() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "as";
		bot.karty[1][1] = "as";
		bot.karty[1][2] = "as";
		bot.karty[1][3] = "as";
		bot.karty[1][4] = "8";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 1;
		a[1] = 1;
		a[2] = 0;
		a[3] = 0;
		a[4] = 0;
		bot.kareta();
		assertArrayEquals(bot.str1, a);
	}

	@Test
	public void testfull() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "as";
		bot.karty[1][1] = "as";
		bot.karty[1][2] = "as";
		bot.karty[1][3] = "8";
		bot.karty[1][4] = "8";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 1;
		a[1] = 1;
		a[2] = 1;
		a[3] = 1;
		a[4] = 0;
		bot.full();
		assertArrayEquals(bot.str2, a);
	}

	@Test
	public void testkolor() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 1;
		a[1] = 1;
		a[2] = 1;
		a[3] = 1;
		a[4] = 1;
		bot.kolor();
		assertArrayEquals(bot.str3, a);
	}

	@Test
	public void teststrit() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "2";
		bot.karty[1][1] = "3";
		bot.karty[1][2] = "4";
		bot.karty[1][3] = "5";
		bot.karty[1][4] = "6";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 1;
		a[1] = 1;
		a[2] = 0;
		a[3] = 0;
		a[4] = 0;
		bot.strit();
		// assertArrayEquals(bot.str4, a);
		assertSame(bot.str[4], 3);

	}

	@Test
	public void testtrojka() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "2";
		bot.karty[1][1] = "2";
		bot.karty[1][2] = "2";
		bot.karty[1][3] = "5";
		bot.karty[1][4] = "6";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 0;
		a[1] = 0;
		a[2] = 1;
		a[3] = 1;
		a[4] = 1;
		bot.trojka();
		// assertArrayEquals(bot.str4, a);
		assertArrayEquals(bot.str5, a);
	}

	@Test
	public void testdwie_pary() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "2";
		bot.karty[1][1] = "2";
		bot.karty[1][2] = "3";
		bot.karty[1][3] = "3";
		bot.karty[1][4] = "6";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 0;
		a[1] = 1;
		a[2] = 1;
		a[3] = 1;
		a[4] = 1;
		bot.dwie_pary();
		// assertArrayEquals(bot.str4, a);
		assertArrayEquals(bot.str6, a);
	}

	@Test
	public void testpara() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "2";
		bot.karty[1][1] = "2";
		bot.karty[1][2] = "3";
		bot.karty[1][3] = "3";
		bot.karty[1][4] = "6";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 0;
		a[1] = 1;
		a[2] = 1;
		a[3] = 0;
		a[4] = 0;
		bot.para();
		// assertArrayEquals(bot.str4, a);
		assertArrayEquals(bot.str7, a);
	}

	@Test
	public void testnajwyzsza_karta() {
		for (int i = 0; i < 5; i++)
			bot.karty[0][i] = "serce";
		bot.karty[1][0] = "as";
		bot.karty[1][1] = "dama";
		bot.karty[1][2] = "3";
		bot.karty[1][3] = "3";
		bot.karty[1][4] = "6";
		bot.uzupelnieni_argumentow();
		bot.ulozenie_kart();
		int a[] = new int[5];
		a[0] = 1;
		a[1] = 1;
		a[2] = 0;
		a[3] = 0;
		a[4] = 0;
		bot.najwyzsza_karta();
		// assertArrayEquals(bot.str4, a);
		assertArrayEquals(bot.str8, a);
	}

	@After
	public void sprzataj() {
	}

}
